

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="https://img.mkerosene.cn/touxiang.jpg">
  <link rel="icon" href="https://img.mkerosene.cn/touxiang.jpg">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="Kerosene W">
  <meta name="keywords" content="">
  
    <meta name="description" content="写在前面 ​        历时将近5天，小破站终于建成！😜只是跟随大佬的教程照抄的一些简单的功能，后续还会慢慢探索…..对于搭建过程网上教程很多 ,我的第一篇博客就简单记录搭建过程中遇到的一些问题还有近期笔记吧。。😂😂 Github搭建过程 安装nodeJS、git和Hexo，注册Github  配置SSH key  部署到Github  主题配置（next)  故障调试方法   安装n">
<meta property="og:type" content="article">
<meta property="og:title" content="My First Blog(博客搭建及部分主题配置)">
<meta property="og:url" content="http://example.com/2020/10/16/My-First-Blog/index.html">
<meta property="og:site_name" content="追求源于热爱">
<meta property="og:description" content="写在前面 ​        历时将近5天，小破站终于建成！😜只是跟随大佬的教程照抄的一些简单的功能，后续还会慢慢探索…..对于搭建过程网上教程很多 ,我的第一篇博客就简单记录搭建过程中遇到的一些问题还有近期笔记吧。。😂😂 Github搭建过程 安装nodeJS、git和Hexo，注册Github  配置SSH key  部署到Github  主题配置（next)  故障调试方法   安装n">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://img.mkerosene.cn/bg9.jpeg">
<meta property="article:published_time" content="2020-10-16T08:24:25.000Z">
<meta property="article:modified_time" content="2021-11-24T03:31:38.449Z">
<meta property="article:author" content="Kerosene W">
<meta property="article:tag" content="blog&#39;s">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://img.mkerosene.cn/bg9.jpeg">
  
  
  <title>My First Blog(博客搭建及部分主题配置) - 追求源于热爱</title>

  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@4/github-markdown.min.css" />
  <link  rel="stylesheet" href="/lib/hint/hint.min.css" />

  
    
    
      
      <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@10/styles/github-gist.min.css" />
    
  

  
    <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.css" />
  


<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_kmeydafke9r.css">


<link  rel="stylesheet" href="/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    var CONFIG = {"hostname":"example.com","root":"/","version":"1.8.13","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"hover","icon":"❡"},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"copy_btn":true,"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"https://img.mkerosene.cn/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":true,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":"FI1uAFAYz0Q3MPDiORqd0JAN-gzGzoHsz","app_key":"EhKAjMe3bmq0WLTSgktGg2OC","server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml"};
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
</head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>mKerosene</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/links/">
                <i class="iconfont icon-link-fill"></i>
                友链
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner" id="banner" parallax=true
         style="background: url('https://img.mkerosene.cn/default.png') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="page-header text-center fade-in-up">
            <span class="h2" id="subtitle" title="Building personal blog&#39;s processing......">
              
            </span>

            
              <div class="mt-3">
  
  
    <span class="post-meta">
      <i class="iconfont icon-date-fill" aria-hidden="true"></i>
      <time datetime="2020-10-16 16:24" pubdate>
        2020年10月16日 下午
      </time>
    </span>
  
</div>

<div class="mt-1">
  
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      5.8k 字
    </span>
  

  
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      19 分钟
    </span>
  

  
  
    
      <!-- LeanCloud 统计文章PV -->
      <span id="leancloud-page-views-container" class="post-meta" style="display: none">
        <i class="iconfont icon-eye" aria-hidden="true"></i>
        <span id="leancloud-page-views"></span> 次
      </span>
    
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">Building personal blog&#39;s processing......</h1>
            
              <p class="note note-info">
                
                  本文最后更新于：1 年前
                
              </p>
            
            <div class="markdown-body">
              <hr>
<h1 id="写在前面"><a href="#写在前面" class="headerlink" title="写在前面"></a>写在前面</h1><hr>
<p>​        历时将近5天，小破站终于建成！😜只是跟随大佬的教程照抄的一些简单的功能，后续还会慢慢探索…..对于搭建过程网上教程很多 ,我的第一篇博客就简单记录搭建过程中遇到的一些问题还有近期笔记吧。。😂😂</p>
<h1 id="Github搭建过程"><a href="#Github搭建过程" class="headerlink" title="Github搭建过程"></a>Github搭建过程</h1><ul>
<li><p>安装nodeJS、git和Hexo，注册Github</p>
</li>
<li><p>配置SSH key</p>
</li>
<li><p>部署到Github</p>
</li>
<li><p>主题配置（next)</p>
</li>
<li><p>故障调试方法</p>
</li>
</ul>
<h2 id="安装nodeJS、git和Hexo，注册Github"><a href="#安装nodeJS、git和Hexo，注册Github" class="headerlink" title="安装nodeJS、git和Hexo，注册Github"></a>安装nodeJS、git和Hexo，注册Github</h2><h3 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h3><ul>
<li>这里主要是Hexo安装时在CMD或Git Bash中执行以下指令：</li>
</ul>
<figure class="highlight gams"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs gams"><span class="hljs-meta"><span class="hljs-meta-keyword">$npm</span> install -g hexo-cli</span><br></code></pre></td></tr></table></figure>


<ul>
<li>但是可能会遇到卡住或安装慢的情况，可以先执行<a target="_blank" rel="noopener" href="https://www.zhihu.com/question/57671550">淘宝镜像</a>：</li>
</ul>
<figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs awk"><span class="hljs-variable">$npm</span> install -g cnpm --registry=https:<span class="hljs-regexp">//</span>registry.npm.taobao.org<br></code></pre></td></tr></table></figure>

<p>同样下面的所有安装步骤都可使用</p>
<h3 id="注册Github"><a href="#注册Github" class="headerlink" title="注册Github"></a>注册Github</h3><ul>
<li><p>注册后在邮箱中认证，点击Start project或者下面的 new repository 创建一个新的仓库<br><a target="_blank" rel="noopener" href="https://imgchr.com/i/BC40Gn"><img src="https://s1.ax1x.com/2020/10/21/BC40Gn.jpg" srcset="https://img.mkerosene.cn/loading.gif" lazyload alt="BC40Gn.jpg"></a></p>
<ul>
<li><p>特别注意！！Github 仅能使用一个同名仓库的代码托管一个静态站点</p>
<p>[<img src="https://s1.ax1x.com/2020/10/21/BC4B2q.jpg" srcset="https://img.mkerosene.cn/loading.gif" lazyload alt="BC4B2q.jpg"></p>
</li>
<li><p>然后打开仓库创建一个 index.html 文件，并随意先写点内容</p>
<p><a target="_blank" rel="noopener" href="https://imgchr.com/i/BC4Dx0"><img src="https://s1.ax1x.com/2020/10/21/BC4Dx0.jpg" srcset="https://img.mkerosene.cn/loading.gif" lazyload alt="BC4Dx0.jpg"></a></p>
</li>
</ul>
</li>
</ul>
<p><a target="_blank" rel="noopener" href="https://imgchr.com/i/BC4a5j"><img src="https://s1.ax1x.com/2020/10/21/BC4a5j.jpg" srcset="https://img.mkerosene.cn/loading.gif" lazyload alt="BC4a5j.jpg"></a></p>
<hr>
<h2 id="配置SSH-key"><a href="#配置SSH-key" class="headerlink" title="配置SSH key"></a>配置SSH key</h2><ul>
<li><p>生成密钥 SSH key后，找到C盘个人账户文件夹/.ssh/id_rsa.pub,打开复制，登录 <a target="_blank" rel="noopener" href="https://github.com/">Github</a> 上添加刚刚生成的SSH key，按以下步骤添加：</p>
<p><a target="_blank" rel="noopener" href="https://imgchr.com/i/BC4wPs"><img src="https://s1.ax1x.com/2020/10/21/BC4wPs.jpg" srcset="https://img.mkerosene.cn/loading.gif" lazyload alt="BC4wPs.jpg"></a></p>
</li>
</ul>
<p><a target="_blank" rel="noopener" href="https://imgchr.com/i/BC4sMV"><img src="https://s1.ax1x.com/2020/10/21/BC4sMV.jpg" srcset="https://img.mkerosene.cn/loading.gif" lazyload alt="BC4sMV.jpg"></a></p>
<p>   这时会收到邮箱<strong>A new public key was added to your account</strong></p>
<ul>
<li>此外还需确认并添加主机到本机SSH可信列表</li>
</ul>
<figure class="highlight autoit"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs autoit">$ssh -T git<span class="hljs-symbol">@github</span>.com<br></code></pre></td></tr></table></figure>

<p>如果提示<code>Are you sure you want to continue connecting (yes/no)?</code></p>
<p>输入yes，若返回 Hi xxx! You’ve successfully authenticated, but GitHub does not provide shell access. 内容，则证明添加成功。</p>
<h2 id="部署到github"><a href="#部署到github" class="headerlink" title="部署到github"></a>部署到github</h2><ul>
<li>配置<code>_config.yml</code>中有关deploy的部分:</li>
</ul>
<p>正确写法：</p>
<figure class="highlight dts"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs dts"><span class="hljs-symbol">deploy:</span><br><span class="hljs-symbol">  type:</span> git<br><span class="hljs-symbol">  repository:</span> git@github.com:liuxianan/liuxianan.github.io.git<br><span class="hljs-symbol">  branch:</span> master<br></code></pre></td></tr></table></figure>

<p>错误写法：</p>
<figure class="highlight dts"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs dts"><span class="hljs-symbol">deploy:</span><br><span class="hljs-symbol">  type:</span> github<br><span class="hljs-symbol">  repository:</span>https:<span class="hljs-comment">//github.com/yourname/yourname.github.io.git</span><br><span class="hljs-symbol">  branch:</span> master<br></code></pre></td></tr></table></figure>

<p>后面一种写法是hexo2.x的写法，现在已经不行了，无论是哪种写法，此时直接执行<code>hexo d</code>的话一般会报如下错误：</p>
<figure class="highlight pgsql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs pgsql">Deployer <span class="hljs-keyword">not</span> <span class="hljs-built_in">found</span>: github 或者 Deployer <span class="hljs-keyword">not</span> <span class="hljs-built_in">found</span>: git<br></code></pre></td></tr></table></figure>

<p>原因是还需要安装一个插件：</p>
<figure class="highlight gams"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs gams"><span class="hljs-meta"><span class="hljs-meta-keyword">$npm</span> install hexo-deployer-git --save</span><br></code></pre></td></tr></table></figure>

<p>Tip:这里可以用淘宝镜像，见上。</p>
<p>部署这个命令一定要用git bash，否则会提示<code>Permission denied (publickey).</code></p>
<ul>
<li><p>必用”三步走”:</p>
<ol>
<li><p><code>hexo clean</code>    清除缓存文件 (db.json) 和已生成的静态文件</p>
</li>
<li><p><code>hexo g</code>             生成静态页面至public目录</p>
</li>
<li><p><code>hexo d</code>             部署到GitHub</p>
</li>
</ol>
</li>
</ul>
<h2 id="主题配置（next"><a href="#主题配置（next" class="headerlink" title="主题配置（next)"></a>主题配置（next)</h2><ul>
<li><p>我使用的是next中的Gemini,所以就简单记录一些功能</p>
<p>站点配置文件<code> _config.yml</code>中theme改为next，默认landscape</p>
<p>首先区分站点配置文件_config.yml指Blog下的 <code> _config.yml</code></p>
<p>另一个在<code>theme</code>下，所有的主题配置几乎都在这两个文件中</p>
</li>
</ul>
<h3 id="个人简介"><a href="#个人简介" class="headerlink" title="个人简介"></a>个人简介</h3><ul>
<li><p>站点配置文件<code> _config.yml</code>下</p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br></pre></td><td class="code"><pre><code class="hljs yaml"><span class="hljs-attr">title:</span> <span class="hljs-comment"># 标题</span><br><span class="hljs-attr">subtitle:</span> <span class="hljs-comment">#副标</span><br><span class="hljs-attr">description:</span> <span class="hljs-comment">#个人描述</span><br><span class="hljs-attr">keywords:</span><br><span class="hljs-attr">author:</span>   <span class="hljs-comment"># 作者</span><br><span class="hljs-attr">language:</span> <span class="hljs-string">zh-CN</span> <span class="hljs-comment"># 主题语言</span><br><span class="hljs-attr">timezone:</span> <span class="hljs-string">Asia/Shanghai</span> <span class="hljs-comment">#不要乱改城市，这里容易出故障，必要时可直接删除试试</span><br><br><span class="hljs-comment"># URL</span><br><span class="hljs-comment">## If your site is put in a subdirectory, set url as &#x27;http://yoursite.com/child&#x27; and root as &#x27;/child/&#x27;</span><br><span class="hljs-attr">url:</span> <span class="hljs-string">https://example。com</span> <span class="hljs-comment">#绑定域名</span><br><span class="hljs-attr">root:</span> <span class="hljs-string">/</span>  <span class="hljs-comment">#默认根路径，指向实际的source</span><br><span class="hljs-attr">permalink:</span> <span class="hljs-string">:year/:month/:day/:title/</span><br><span class="hljs-attr">permalink_defaults:</span><br><span class="hljs-attr">pretty_urls:</span><br>  <span class="hljs-attr">trailing_index:</span> <span class="hljs-literal">true</span> <span class="hljs-comment"># Set to false to remove trailing &#x27;index.html&#x27; from permalinks</span><br>  <span class="hljs-attr">trailing_html:</span> <span class="hljs-literal">true</span> <span class="hljs-comment"># Set to false to remove trailing &#x27;.html&#x27; from permalinks</span><br><br><span class="hljs-comment"># Directory</span><br><span class="hljs-attr">source_dir:</span> <span class="hljs-string">source</span><br><span class="hljs-attr">public_dir:</span> <span class="hljs-string">public</span><br><span class="hljs-attr">tag_dir:</span> <span class="hljs-string">tags</span><br><span class="hljs-attr">archive_dir:</span> <span class="hljs-string">archives</span><br><span class="hljs-attr">category_dir:</span> <span class="hljs-string">categories</span><br><span class="hljs-attr">code_dir:</span> <span class="hljs-string">downloads/code</span><br><span class="hljs-attr">i18n_dir:</span> <span class="hljs-string">:lang</span><br><span class="hljs-attr">skip_render:</span> <span class="hljs-string">README.md</span> <span class="hljs-comment">#部署的时候不包含的文件</span><br><br><span class="hljs-comment"># Writing</span><br><span class="hljs-attr">new_post_name:</span> <span class="hljs-string">:title.md</span> <span class="hljs-comment">#默认的新博文名称</span><br><span class="hljs-attr">default_layout:</span> <span class="hljs-string">post</span> <span class="hljs-comment">#默认布局</span><br><span class="hljs-attr">titlecase:</span> <span class="hljs-literal">false</span> <span class="hljs-comment">#Transform title into titlecase</span><br><span class="hljs-attr">external_link:</span><br>  <span class="hljs-attr">enable:</span> <span class="hljs-literal">true</span> <span class="hljs-comment">#Open external links in new tab</span><br>  <span class="hljs-attr">field:</span> <span class="hljs-string">site</span> <span class="hljs-comment">#Apply to the whole site</span><br>  <span class="hljs-attr">exclude:</span> <span class="hljs-string">&#x27;&#x27;</span><br><span class="hljs-attr">filename_case:</span> <span class="hljs-number">0</span> <span class="hljs-comment">#把博客名称改成小写/大写（1,2）</span><br><span class="hljs-attr">render_drafts:</span> <span class="hljs-literal">false</span> <span class="hljs-comment">#是否显示草稿</span><br><span class="hljs-attr">post_asset_folder:</span> <span class="hljs-literal">false</span> <span class="hljs-comment">#是否启用资源文件夹（用来存放相对路径图片或文件）</span><br><span class="hljs-attr">relative_link:</span> <span class="hljs-literal">false</span> <span class="hljs-comment"># 把链接改为与根目录的相对位址</span><br><span class="hljs-attr">future:</span> <span class="hljs-literal">true</span><br><span class="hljs-attr">highlight:</span><br>  <span class="hljs-attr">enable:</span> <span class="hljs-literal">true</span> <span class="hljs-comment">#是否开启代码高亮</span><br>  <span class="hljs-attr">line_number:</span> <span class="hljs-literal">true</span> <span class="hljs-comment">#是否增加代码行号</span><br>  <span class="hljs-attr">auto_detect:</span> <span class="hljs-literal">true</span> <span class="hljs-comment">#自动判断代码语言</span><br>  <span class="hljs-attr">tab_replace:</span> <span class="hljs-string">&#x27;&#x27;</span><br><span class="hljs-attr">wrap:</span> <span class="hljs-literal">true</span><br><span class="hljs-attr">hljs:</span> <span class="hljs-literal">false</span><br><span class="hljs-attr">prismjs:</span><br><span class="hljs-attr">enable:</span> <span class="hljs-literal">false</span><br><span class="hljs-attr">preprocess:</span> <span class="hljs-literal">true</span><br><span class="hljs-attr">line_number:</span> <span class="hljs-literal">true</span><br><span class="hljs-attr">tab_replace:</span> <span class="hljs-string">&#x27;&#x27;</span><br><br><span class="hljs-comment"># Home page setting</span><br><span class="hljs-comment"># path: Root path for your blogs index page. (default = &#x27;&#x27;)</span><br><span class="hljs-comment"># per_page: Posts displayed per page. (0 = disable pagination)</span><br><span class="hljs-comment"># order_by: Posts order. (Order by date descending by default)</span><br><span class="hljs-attr">index_generator:</span> <span class="hljs-comment">#首页博客分布</span><br>  <span class="hljs-attr">path:</span> <span class="hljs-string">&#x27;&#x27;</span> <span class="hljs-comment">#博客的默认路径</span><br>  <span class="hljs-attr">per_page:</span> <span class="hljs-number">10</span> <span class="hljs-comment">#每页博客数量上限</span><br>  <span class="hljs-attr">order_by:</span> <span class="hljs-string">-date</span> <span class="hljs-comment">#博客排序</span><br><br><span class="hljs-comment"># Date / Time format</span><br><span class="hljs-comment">## Hexo uses Moment.js to parse and display date</span><br><span class="hljs-comment">## You can customize the date format as defined in</span><br><span class="hljs-comment">## http://momentjs.com/docs/#/displaying/format/</span><br><span class="hljs-attr">date_format:</span> <span class="hljs-string">YYYY-MM-DD</span> <span class="hljs-comment">#博客日期格式</span><br><span class="hljs-attr">time_format:</span> <span class="hljs-string">HH:mm:ss</span> <span class="hljs-comment">#博客时间格式</span><br><span class="hljs-comment">## updated_option supports &#x27;mtime&#x27;, &#x27;date&#x27;, &#x27;empty&#x27;</span><br><span class="hljs-attr">updated_option:</span> <span class="hljs-string">&#x27;mtime&#x27;</span><br><br><span class="hljs-comment"># Pagination</span><br><span class="hljs-comment">## Set per_page to 0 to disable pagination</span><br><span class="hljs-attr">per_page:</span> <span class="hljs-number">10</span> <span class="hljs-comment">#同上</span><br><span class="hljs-attr">pagination_dir:</span> <span class="hljs-string">page</span><br><br><span class="hljs-comment">#归档页的分页设置</span><br><span class="hljs-attr">archive_generator:</span> <span class="hljs-comment">#归档页的配置</span><br>  <span class="hljs-attr">per_page:</span> <span class="hljs-number">30</span> <span class="hljs-comment">#归档页每页博客数</span><br>  <span class="hljs-attr">yearly:</span> <span class="hljs-literal">true</span> <span class="hljs-comment">#按年归档</span><br>  <span class="hljs-attr">monthly:</span> <span class="hljs-literal">true</span> <span class="hljs-comment">#按月归档</span><br><span class="hljs-comment">#标签页的分页设置</span><br><span class="hljs-attr">tag_generator:</span><br>  <span class="hljs-attr">per_page:</span> <span class="hljs-number">20</span> <span class="hljs-comment">#标签页每页博客数</span><br><br><span class="hljs-comment"># Deployment</span><br><span class="hljs-comment">## Docs: https://hexo.io/docs/deployment.html</span><br><span class="hljs-attr">deploy:</span> <span class="hljs-comment">#博客部署</span><br>  <span class="hljs-attr">type:</span> <span class="hljs-string">git</span><br>  <span class="hljs-string">repo:git@github.com:yourname/yourname.github.io.git</span><br><span class="hljs-attr">branch:</span> <span class="hljs-string">master</span><br></code></pre></td></tr></table></figure></li>
</ul>
<ul>
<li><p>next主题设置</p>
<figure class="highlight dts"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><code class="hljs dts">override：false <span class="hljs-meta">#表示是否将主题置为默认样式</span><br><span class="hljs-symbol">cache:</span><br><span class="hljs-symbol">	enable:</span>true <span class="hljs-meta">#表示添加缓存功能，这样浏览器后续打开我们的博客网站会更快</span><br><span class="hljs-symbol">menu:</span> <span class="hljs-meta">#设置博客各个页面的相对路径，默认根路径是blog/source</span><br><span class="hljs-symbol">  home:</span> / || home<br><span class="hljs-symbol">  about:</span> <span class="hljs-meta-keyword">/about/</span> || user<br><span class="hljs-symbol">  tags:</span> <span class="hljs-meta-keyword">/tags/</span> || tags<br><span class="hljs-symbol">  categories:</span> <span class="hljs-meta-keyword">/categories/</span> || th<br><span class="hljs-symbol">  archives:</span> <span class="hljs-meta-keyword">/archives/</span> || archive<br>  <span class="hljs-meta">#schedule: /schedule/ || calendar #日历</span><br>  <span class="hljs-meta">#sitemap: /sitemap.xml || sitemap #站点地图，供搜索引擎爬取</span><br>  <span class="hljs-meta">#commonweal: /404/ || heartbeat # 腾讯公益404</span><br><br><span class="hljs-meta"># Enable/Disable menu icons / item badges.</span><br><span class="hljs-symbol">menu_settings:</span><br><span class="hljs-symbol">  icons:</span> true <span class="hljs-meta"># 是否显示各个页面的图标</span><br><span class="hljs-symbol">  badges:</span> true <span class="hljs-meta"># 是否显示分类/标签/归档页的内容量</span><br><span class="hljs-meta"># Schemes</span><br><span class="hljs-symbol">scheme:</span> Gemini<br></code></pre></td></tr></table></figure>
<p>语句前加<code>#</code>即为注释或按钮关闭，而加注释时也要先一个空格，用<code>Sublime Text 3</code>体验会比较明显，操作错误不会有对应颜色变化。</p>
</li>
</ul>
<h3 id="添加评论"><a href="#添加评论" class="headerlink" title="添加评论"></a>添加评论</h3><ul>
<li><p>主题配置文件中搜索<code>valine</code>,改为<code>ture</code></p>
</li>
<li><p>注册登录<a target="_blank" rel="noopener" href="https://leancloud.cn/">LeanCloud</a>，创建应用-设置-应用Keys，分别复制AppID、AppKey到文件中对应位置即可    </p>
</li>
</ul>
<h3 id="添加字数统计和阅读时长"><a href="#添加字数统计和阅读时长" class="headerlink" title="添加字数统计和阅读时长"></a>添加字数统计和阅读时长</h3><ul>
<li><p>先安装插件（Bash耐心等待~）</p>
<figure class="highlight applescript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs applescript">$npm install hexo-symbols-<span class="hljs-built_in">count</span>-<span class="hljs-built_in">time</span> <span class="hljs-comment">--save</span><br></code></pre></td></tr></table></figure></li>
</ul>
<ul>
<li><p>站点配置文件下添加</p>
  <figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs yaml"><span class="hljs-comment">#字数统计</span><br> <span class="hljs-attr">symbols_count_time:</span><br>  <span class="hljs-attr">symbols:</span> <span class="hljs-literal">true</span> <span class="hljs-comment">#是否统计字数</span><br>  <span class="hljs-attr">time:</span> <span class="hljs-literal">false</span> <span class="hljs-comment">#是否统计阅读时长</span><br>  <span class="hljs-attr">total_symbols:</span> <span class="hljs-literal">true</span> <span class="hljs-comment">#是否统计总字数</span><br>  <span class="hljs-attr">total_time:</span> <span class="hljs-string">ture</span> <span class="hljs-comment">#是否统计总阅读时长</span><br></code></pre></td></tr></table></figure>
</li>
<li><p>主题的配置文件下开启 symbols_count_time 字段</p>
<p>执行“三步走”就可以看到了。。。</p>
</li>
</ul>
<h3 id="更新"><a href="#更新" class="headerlink" title="更新"></a>更新</h3><p>新版本的NexT将每月发布。可以通过以下命令更新 NexT。<br>安装最新版本的 npm：<br><code>$ cd hexo-site</code><br><code>$ npm update hexo-theme-next</code><br>或更新到最新的主分支：<br><code>$ cd themes/next</code><br><code>$ git pull</code></p>
<h3 id="不显示全部内容"><a href="#不显示全部内容" class="headerlink" title="不显示全部内容"></a>不显示全部内容</h3><ul>
<li>修改主题配置文件</li>
</ul>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs yaml"><span class="hljs-comment"># Automatically excerpt description in homepage as preamble text.</span><br><span class="hljs-attr">excerpt_description:</span> <span class="hljs-literal">true</span> <span class="hljs-comment">#自动截取摘要</span><br><br><span class="hljs-comment"># Read more button</span><br><span class="hljs-comment"># If true, the read more button would be displayed in excerpt section.</span><br><span class="hljs-attr">read_more_btn:</span> <span class="hljs-literal">true</span> <span class="hljs-comment">#显示阅读全文按钮</span><br></code></pre></td></tr></table></figure>
<ul>
<li>写文章时在合适的位置加上<code>&lt;!--more--&gt;</code>即可</li>
</ul>
<h3 id="添加博客自定义图标"><a href="#添加博客自定义图标" class="headerlink" title="添加博客自定义图标"></a>添加博客自定义图标</h3><p>默认为<code>Hexo</code>的标识，图标可以在<a target="_blank" rel="noopener" href="https://www.easyicon.net/">easyicon</a>、<a target="_blank" rel="noopener" href="http://www.bitbug.net/">bitbug</a>、<a target="_blank" rel="noopener" href="https://www.iconfont.cn/plus/user/detail?uid=41718)">iconfont</a>等网站选择和制作，我是在<a target="_blank" rel="noopener" href="https://www.iconfont.cn/plus/user/detail?uid=41718)">iconfont</a>上找的，下载放到blog/themes/next/sources/images目录下，并在主题配置文件更改：</p>
<figure class="highlight dts"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs dts"><span class="hljs-symbol">favicon:</span><br><span class="hljs-symbol">  small:</span> <span class="hljs-meta-keyword">/images/</span>****.png <span class="hljs-meta">#对应一</span><br><span class="hljs-symbol">  medium:</span> <span class="hljs-meta-keyword">/images/</span>****.png <span class="hljs-meta">#二两个位置</span><br><span class="hljs-symbol">  apple_touch_icon:</span> <span class="hljs-meta-keyword">/images/</span><span class="hljs-number">128</span>x128.png<br><span class="hljs-symbol">  safari_pinned_tab:</span> <span class="hljs-meta-keyword">/images/</span>logo2.svg<br></code></pre></td></tr></table></figure>

<h3 id="本地图片上传"><a href="#本地图片上传" class="headerlink" title="本地图片上传"></a>本地图片上传</h3><ul>
<li><p>先将图片上传至<a target="_blank" rel="noopener" href="https://imgchr.com/">路过图床</a>或其他图床</p>
</li>
<li><p>在name.md中使用<code>![名称](**)</code>      **拷贝图片链接</p>
</li>
</ul>
<hr>
<h2 id="故障调试方法"><a href="#故障调试方法" class="headerlink" title="故障调试方法"></a>故障调试方法</h2><ul>
<li>我主要是使用很传统的方法，即下载一份原始主题，若出现Error（看不懂）可以对应退回几步，从原文件拷贝复原</li>
<li>还有一个备份方法，还没学会·····在路上去😊</li>
</ul>
<hr>
<p>等等等等，还有很多，当然主要参考[<a target="_blank" rel="noopener" href="https://blog.csdn.net/nightmare_dimple/article/details/86661502]">https://blog.csdn.net/nightmare_dimple/article/details/86661502]</a></p>
<p>[<a target="_blank" rel="noopener" href="https://www.cnblogs.com/liuxianan/p/build-blog-website-by-hexo-github.html]">https://www.cnblogs.com/liuxianan/p/build-blog-website-by-hexo-github.html]</a></p>
<p>[<a target="_blank" rel="noopener" href="https://segmentfault.com/a/1190000017986794]">https://segmentfault.com/a/1190000017986794]</a></p>
<p>感谢大佬细致的菜鸟教程，我get了好多干货<del>·</del>·~</p>
<h1 id="写在后面"><a href="#写在后面" class="headerlink" title="写在后面"></a>写在后面</h1><ul>
<li><p>时间紧，任务重，能力有限，但一直没有停下的心，就想我的Subtitle一样，<strong>追求源于热爱！！</strong></p>
</li>
<li><p>My description：我们努力奔跑，只为追上那个曾被寄予厚望的自己。</p>
</li>
</ul>
<p>另外友链推广大佬···😁</p>
<p>博客后期更换gitee，本章介绍围绕github但主题配置无区别。</p>
<p><strong>感谢光顾</strong>👏</p>
<hr>

            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                  <div class="post-meta mr-3">
                    <i class="iconfont icon-category"></i>
                    
                      <a class="hover-with-bg" href="/categories/note/">note</a>
                    
                  </div>
                
                
                  <div class="post-meta">
                    <i class="iconfont icon-tags"></i>
                    
                      <a class="hover-with-bg" href="/tags/blog-s/">blog's</a>
                    
                  </div>
                
              </div>
              
                <p class="note note-warning">
                  
                    本博客所有文章除特别声明外，均采用 <a target="_blank" href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" rel="nofollow noopener noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！
                  
                </p>
              
              
                <div class="post-prevnext">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2020/10/23/Linux%E5%AE%89%E8%A3%85/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">Kali Linux安装保姆级教程</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                  </article>
                </div>
              
            </div>

            
              <!-- Comments -->
              <article class="comments" id="comments" lazyload>
                
                  
                
                
  <div id="twikoo"></div>
  <script type="text/javascript">
    Fluid.utils.loadComments('#comments', function() {
      Fluid.utils.createScript('https://cdn.jsdelivr.net/npm/twikoo@1/dist/twikoo.all.min.js', function() {
        var options = Object.assign(
          {"envId":"blog-3gentarg3e6a1b5e","region":"ap-shanghai","path":"window.location.pathname"},
          {
            el: '#twikoo',
            path: 'window.location.pathname',
            onCommentLoaded: function() {
              Fluid.plugins.initFancyBox('#twikoo .tk-content img:not(.tk-owo-emotion)');
            }
          }
        )
        twikoo.init(options)
      });
    });
  </script>
  <noscript>Please enable JavaScript to view the comments</noscript>


              </article>
            
          </article>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->


    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
    

    
  </main>

  <footer class="text-center mt-5 py-3">
  <div class="footer-content">
     <div class="copyright">&copy;2020 - 2021 By Kerosene.W</div> <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
  </div>
  
  <div class="statistics">
    
    

    
      
        <!-- LeanCloud 统计PV -->
        <span id="leancloud-site-pv-container" style="display: none">
            总访问量 
            <span id="leancloud-site-pv"></span>
             次
          </span>
      
      
        <!-- LeanCloud 统计UV -->
        <span id="leancloud-site-uv-container" style="display: none">
            总访客数 
            <span id="leancloud-site-uv"></span>
             人
          </span>
      

    
  </div>


  

  
</footer>


  <!-- SCRIPTS -->
  
  <script  src="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js" ></script>
<script  src="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>

<!-- Plugins -->


  <script  src="/js/local-search.js" ></script>



  
    <script  src="/js/img-lazyload.js" ></script>
  



  



  
    <script  src="https://cdn.jsdelivr.net/npm/tocbot@4/dist/tocbot.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/anchor-js@4/anchor.min.js" ></script>
  
  
    <script defer src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js" ></script>
  




  <script defer src="/js/leancloud.js" ></script>



  <script  src="https://cdn.jsdelivr.net/npm/typed.js@2/lib/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var title = document.getElementById('subtitle').title;
      
        typing(title);
      
    })(window, document);
  </script>












  

  

  

  

  

  





<!-- 主题的启动项 保持在最底部 -->
<script  src="/js/boot.js" ></script>


</body>
</html>
